from django.db import models
from app.gender.models import McGender
from app.role.models import McRole

class McManage(models.Model):
    phone = models.BigIntegerField(null=True, blank=True, unique=False)
    name = models.CharField(max_length=100, null=True, blank=True)

    gender = models.ForeignKey(
        McGender,
        on_delete=models.SET_NULL,
        null=True,
        blank=True,
        db_column="gender_id",

    )
    user_name = models.CharField(max_length=100)
    password = models.CharField(max_length=100)

    role = models.ForeignKey(
        McRole,
        on_delete=models.SET_NULL,
        null=True,
        blank=True,
        db_column="role_id",

    )

    created_time = models.DateTimeField(auto_now_add=True)
    updated_time = models.DateTimeField(auto_now=True)

    class Meta:
        db_table = 'mc_manage'
        verbose_name = '管理员'
        verbose_name_plural = '管理员'